package com.example.b_308.myapplication.comment.base;


import com.example.b_308.myapplication.comment.utils.L;
import com.example.b_308.myapplication.service.base.BaseService;

/**
 * Created by tongkang on 2017/4/8.
 * 给程序中每个模块提供一个service去处理数据.
 */

public class WorkUIService extends BaseService {
    private static WorkUIService geekUIService;
//    UserService userService;

    /**
     * 初始化服务
     */
    private void initService() {
        geekUIService = new WorkUIService();
//        userService = UserService.getInstance();
    }

    /**
     * 开始服务
     */
    private void startService() throws Exception {
//        userService.start(getContext());

    }

    /**
     * 停止服务
     */
    private void stopService() throws Exception {
//        userService.stop();

    }


    @Override
    protected void onStart() throws Exception {
        try {
            initService();
            startService();
        } catch (Exception e) {
            L.d("service启动"+ WorkUIService.getInstance().getClass().getName(), e.getMessage());
        }

    }


    @Override
    protected void onStop() throws Exception {
        try {
            stopService();
        } catch (Exception e) {
            L.d("service停止" + WorkUIService.getInstance().getClass().getName(), e.getMessage());
        }
    }


    public static WorkUIService getInstance() {
        return geekUIService;
    }
}
